<?php
if($model->CheckReview()) : ?>
	<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'review-form',
		'enableAjaxValidation'=>false,

	)); ?>
		<!-- Stars -->
		<div id="reviews_stars">
			<?php $this->renderPartial('_stars', array('form'=>$form, 'model'=>$model, 'review'=>$review, 'rating'=>$rating,'readOnly'=>false)/*, false, true*/); ?>
		</div>
		<!-- Error -->
		<div class="row cl" id="render_review">
			<?php echo $form->errorSummary($review); ?>
		</div>
		<!-- Comment -->
		<div class="post_form br5">
			<div class="av ">
				<div class="br5"><?php echo $this->material_image(Yii::app()->user->id, Yii::app()->user->getState('avatar'), '68', 'images/' . Yii::app()->user->id); ?></div>
				<span><?php echo Yii::app()->user->name; ?></span>
			</div>
			<?php echo $form->labelEx($review,'text'); ?>
			<?php echo $form->error($review,'text'); ?>
			<?php echo $form->textArea($review,'text',array('rows'=>3)); ?>
			<input type="hidden" name="object_id" value="<?php echo $object_id; ?>" />
			<div class="cl"> 
				<span class="btn blue br5 fl">
					<?php echo CHtml::submitButton('Reply'); ?>
				</span>
			</div>
		</div>
	<?php $this->endWidget(); ?>
<?php else : ?>
	<div id="reviews_stars">
		<?php $this->renderPartial('_stars', array('model'=>$model,  'rating'=>$rating,'readOnly'=>true)); ?>
	</div>
<?php endif ?>